<template>
  <div>
    <el-row :gutter="20">
      <el-col :span="6" :offset="0" v-for="(item, index) in panels" :key="index">
        <el-card shadow="hover" class="border-0">
          <template #header>
            <div class="flex justify-between">
              <span class="text-sm">{{ item.title }}</span>
              <el-tag :type="item.unitCorlor" effect="plain">
                {{ item.unit }}</el-tag>
            </div>
          </template>
          <span class="text-3xl font-bold text-gray-500">
            <CounTo :value="item.value" />
          </span>
          <el-divider></el-divider>
          <div class="flex justify-between text-sm text-gray-500">
            <span>{{ item.subTitle }}</span>
            <span>{{ item.subValue }}</span>
          </div>
        </el-card>
      </el-col>
    </el-row>
  </div>
  <div>
    <sq-button>aegae</sq-button>
  </div>
</template>
<script setup>
import { ref } from "vue";
import { getStatistics1 } from "../api/index";
import CounTo from "../components/CountTo.vue";
const panels = ref([]);
getStatistics1().then((res) => {
  panels.value = res.panels;
  console.log(res.panels);
});
</script>
